package net.yunzhanyi.common.web.util.encoder;

/**
 * @author qiuxin
 * @code PasswordEncoder
 * @date 2022/4/6
 * description：
 */

public interface PasswordEncoder {
    /**
     *
     * @param rawPassword
     * @return
     */
    String encode(CharSequence rawPassword);

    /**
     * @param rawPassword
     * @param encodedPassword
     * @return
     */
    boolean matches(CharSequence rawPassword, String encodedPassword);

    /**
     * @param encodedPassword
     * @return
     */
    default boolean upgradeEncoding(String encodedPassword) {
        return false;
    }
}
